Skip to content

Add Exie AI assistant - #2430

Open
ejsmith wants to merge 16 commits into
mainfrom
feature/exie-assistant
Open

Add Exie AI assistant#2430
ejsmith wants to merge 16 commits into
mainfrom
feature/exie-assistant

Conversation

@ejsmith

@ejsmith ejsmith commented Aug 3, 2026

Copy link
Copy Markdown
Member

What changed

  • Add Exie, an in-app AI assistant that opens from the main toolbar without replacing the user's current stack or event workflow.
  • Stream conversations through the Exceptionless API with Markdown formatting, links, copy/feedback actions, expandable tool activity, suggested follow-ups, and current page/detail-sheet context.
  • Let Exie investigate through the Exceptionless MCP tools, including the existing low-risk write tools, with server-enforced organization boundaries and exact user authorization for mutations.
  • Add feature configuration for OpenRouter-compatible chat completions. The feature defaults on when an API key is configured, can be disabled completely, and keeps credentials in deployment secrets/environment variables.
  • Restrict hosted access to Medium plans and above while keeping development mode available for testing. Plan options control concurrency, per-minute turns, monthly tokens, and monthly cost.
  • Make conversations and limits web-farm safe through the shared cache. Persist monthly per-organization usage, cost, outcome, tool, and limit statistics; emit aggregate OpenTelemetry metrics; and expose a global-admin usage report in System → Exie.
  • Include the assistant and admin usage API contracts in OpenAPI and the HTTP samples.

Why

Exceptionless users should be able to investigate errors, stacks, and events conversationally without leaving their current workflow. The first production version also needs predictable provider spend, plan-based access, web-farm correctness, operational visibility, and a complete off switch for self-hosted installations.

Plan limits

Plan Concurrent turns Turns/minute Monthly tokens Monthly cost
Medium 2 10 25M $5
Large 3 15 50M $10
Extra Large 5 25 100M $20
Enterprise 10 50 250M $50
Unlimited 20 100 500M $100

Free and Small plans receive the upgrade experience. Annual plans use the corresponding monthly allowance.

Operational impact

  • Organization index version increases to store rolling assistant usage history.
  • Usage is aggregated through the existing distributed usage pipeline and retained for 366 days.
  • Monthly limit counters rehydrate from durable organization usage after shared-cache loss, and provider requests reserve conservative usage until actual provider totals arrive.
  • GET /api/v2/admin/assistant-usage powers the global-admin monthly totals, per-organization consumption, plan utilization, and blocked-attempt reporting in System → Exie.
  • No API key or provider credential is committed.
  • No existing public API or WebSocket contract is intentionally broken.

Validation

  • npm run validate — formatting, ESLint, and svelte-check passed with 0 errors and 0 warnings.
  • Focused Svelte/Vitest coverage — 11 files, 20 tests passed.
  • Clean dotnet build ./Exceptionless.slnx --no-restore --configuration Release — passed with 0 warnings and 0 errors.
  • Focused Release regression coverage for Exie, MCP, usage persistence, OpenAPI, and endpoint manifests — 193 tests passed.
  • Live GitHub checks — Docker build, client validation/tests, Playwright E2E, and the full .NET test suite with coverage all passed.
  • All 19 review threads were answered and resolved.
  • git diff --check passed.

@ejsmith
ejsmith marked this pull request as ready for review August 3, 2026 05:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be0b03b29c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Api/Endpoints/AssistantEndpoints.cs
Comment thread src/Exceptionless.Web/Api/Endpoints/AssistantEndpoints.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8f9ec4b33

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Api/Endpoints/AssistantEndpoints.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fadb9a1993

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Assistant/AssistantUsageService.cs
Comment thread src/Exceptionless.Web/Assistant/AssistantService.cs
Comment thread src/Exceptionless.Web/Api/Endpoints/AdminEndpoints.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d6f0fb55a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Assistant/AssistantService.cs Outdated
Comment thread src/Exceptionless.Web/Assistant/AssistantAccessService.cs

@niemyjski niemyjski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and sweet feature, left some comments mostly on magic strings.

Also, what do we want to do for /docs/ and or running locally, would it detect ollama automatically?

Comment thread src/Exceptionless.Core/Configuration/AssistantOptions.cs Outdated
Comment thread src/Exceptionless.Core/Repositories/Configuration/Indexes/OrganizationIndex.cs Outdated
Comment thread src/Exceptionless.Core/Services/UsageService.cs Outdated
Comment thread src/Exceptionless.Web/Assistant/AssistantToolResultSerializer.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b083c501cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c993cd38c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Assistant/AssistantAccessService.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd4d2054cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Mcp/ExceptionlessMcpTools.cs
Comment thread src/Exceptionless.Web/Assistant/AssistantUsageService.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c367aa420

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Exceptionless.Web/Assistant/AssistantService.cs Outdated
Comment thread src/Exceptionless.Web/Mcp/ExceptionlessMcpTools.cs Outdated

ejsmith commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@niemyjski Regarding /docs/ and local/self-hosted use: I kept provider discovery explicit in this PR. Exie uses the configured OpenAI-compatible Assistant:Endpoint and Assistant:Model, and it only becomes available when it is configured; it does not probe for or silently switch to Ollama. A local Ollama instance can be used by pointing those settings at Ollama's OpenAI-compatible chat-completions endpoint (with a non-empty local placeholder key if the endpoint does not require auth). I think the right follow-up is a short dedicated Exie/self-hosting docs page with OpenRouter and Ollama examples, rather than putting this in the Kubernetes topic. The automatic-detection behavior is intentionally out of scope because it would make production provider selection surprising.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Core 75% 67% 10041
Exceptionless.AppHost 38% 40% 143
Exceptionless.Insulation 37% 35% 286
Exceptionless.Web 84% 68% 7738
Summary 78% (24614 / 31678) 67% (11498 / 17255) 18208

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 825fe1e5aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +159 to +161
_cache.IncrementAsync(GetUsageKey(organizationId, month.Id, "reserved-prompt-tokens"), promptTokens, month.ResetAtUtc.UtcDateTime),
_cache.IncrementAsync(GetUsageKey(organizationId, month.Id, "reserved-completion-tokens"), completionTokens, month.ResetAtUtc.UtcDateTime),
_cache.IncrementAsync(GetUsageKey(organizationId, month.Id, "reserved-cost-microdollars"), costInMicrodollars, month.ResetAtUtc.UtcDateTime));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Persist unreconciled provider reservations

When a provider stream is cancelled or ends without a usage frame, these conservative token and cost reservations remain only in Redis; the durable increment at request start records only ProviderRequests, and the cancellation path never transfers the reservation into durable usage. Fresh evidence after the earlier cancellation and rehydration fixes is that a Redis restart then seeds actual counters from the organization record while explicitly resetting all reserved counters to zero, so provider spend from those requests disappears from monthly enforcement and organizations receive that allowance again. Persist the conservative charge when it cannot be reconciled, or otherwise include outstanding reservations in durable rehydration.

Useful? React with 👍 / 👎.

return toolName switch
{
UpdateStackStatusTool => HasExplicitStackStatusRequest(latestUserMessage, root),
SnoozeStackTool => ContainsAny(latestUserMessage, "snooze"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Match the requested snooze duration before allowing the write

When the user explicitly asks to snooze a stack for a bounded period, this guard checks only that the message contains the word snooze; it does not compare the requested duration or UTC deadline with the tool arguments. Fresh evidence after the earlier exact-approval concern is that “snooze this stack for one hour” therefore authorizes a provider call that snoozes it for a week or until any other supplied time, potentially suppressing notifications far longer than approved. Require the tool's duration or snoozeUntilUtc to match the user's requested mutation.

Useful? React with 👍 / 👎.

Comment on lines +34 to +36
.Produces(StatusCodes.Status403Forbidden)
.ProducesProblem(StatusCodes.Status426UpgradeRequired)
.ProducesProblem(StatusCodes.Status429TooManyRequests);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish the chat endpoint's configuration failures

When Exie is disabled or enabled without an API key, MapAccessFailure returns 404 or 503 before streaming, but the chat endpoint metadata and regenerated OpenAPI snapshot expose neither response. Fresh evidence after the endpoint was added to OpenAPI is that the final snapshot still lists only 200/400/401/403/426/429, so generated clients receive undocumented statuses in these normal deployment configurations. Add the 404 and 503 response contracts and regenerate the snapshot.

AGENTS.md reference: AGENTS.md:L68-L68

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants